package com.bifang.module.file.dao.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.Date;
import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * @author chenzh
 * @since 2021-01-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("FILE_ENV")
@Schema(title ="FileEnv对象", description = "")
// @KeySequence(value = "SQ_FILE_ENV_ID", clazz = Long.class)
public class FileEnv extends Model<FileEnv> {

    private static final long serialVersionUID = 1L;

    @Schema(title = "文件环境主键")
    @TableId(value = "FILE_ENV_ID", type = IdType.ASSIGN_ID)
    private Long fileEnvId;

    @Schema(title = "环境名称")
    @TableField("ENV_NAME")
    private String envName;

    @Schema(title = "文件服务器类型 ftp sftp socket fastfds local http")
    @TableField("FILE_SERVICE_TYPE")
    private String fileServiceType;

    @Schema(title = "文件服务ip")
    @TableField("FILE_SERVICE_IP")
    private String fileServiceIp;

    @Schema(title = "端口")
    @TableField("FILE_SERVICE_PORT")
    private Long fileServicePort;

    @Schema(title = "用户")
    @TableField("FILE_SERVICE_USER")
    private String fileServiceUser;

    @Schema(title = "密码")
    @TableField("FILE_SERVICE_PWD")
    private String fileServicePwd;

    @Schema(title = "存储服务器组（FastDFS）")
    @TableField("STORAGE_GROUP")
    private String storageGroup;

    @Schema(title = "文件存放基础路径")
    @TableField("FILE_BASE_PATH")
    private String fileBasePath;

    @Schema(title = "描述")
    @TableField("REMARKS")
    private String remarks;

    @Schema(title = "静态文件服务访问端口")
    @TableField("WEB_PORT")
    private Long webPort;

    @Schema(title = "静态文件访问基础路径")
    @TableField("WEB_BASE_PATH")
    private String webBasePath;

    @Schema(title = "创建人")
    @TableField(
            value = "CREATE_NAME",
            fill = FieldFill.INSERT,
            updateStrategy = FieldStrategy.NOT_NULL)
    private String createName;

    @Schema(title = "创建时间")
    @TableField(
            value = "CREATE_TIME",
            fill = FieldFill.INSERT,
            updateStrategy = FieldStrategy.NOT_NULL)
    private Date createTime;

    @Schema(title = "更新人")
    @TableField(
            value = "UPDATE_NAME",
            fill = FieldFill.INSERT_UPDATE,
            updateStrategy = FieldStrategy.NOT_NULL)
    private String updateName;

    @Schema(title = "更新时间")
    @TableField(
            value = "UPDATE_TIME",
            fill = FieldFill.INSERT_UPDATE,
            updateStrategy = FieldStrategy.NOT_NULL)
    private Date updateTime;

    @Schema(title = "逻辑删除标志 0 未删除 1 删除")
    @TableField(value = "DEL", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    @TableLogic
    private String del;

    @Override
    public Serializable pkVal() {
        return this.fileEnvId;
    }
}
